﻿using System;
using System.Drawing;
using System.Drawing.Text;
using System.Windows.Forms;

namespace GDI测试
{
    public partial class Form1 : Form
    {
        PrivateFontCollection a = new PrivateFontCollection();

        public Form1()
        {
            InitializeComponent();
            this.Text = "KeyFansClubs 贪吃蛇";
            this.ShowIcon = false;
        }

        //readonly Font FontFzxy = new Font("宋体", 12, FontStyle.Regular,GraphicsUnit.Pixel);
        //readonly Font FontFzTjls = new Font("黑体", 14, FontStyle.Regular, GraphicsUnit.Pixel);

        protected override void OnPaintBackground(PaintEventArgs e)
        {
            base.OnPaintBackground(e);
        }

        protected override void OnPaint(PaintEventArgs e)
        {

            //Stopwatch t = new Stopwatch();
            //t.Start();

            base.OnPaint(e);

            //e.Graphics.DrawString("娃哈哈看得见哦 AaBbCc@#$%^&*IO " + delta, FontFzxy, Brushes.Blue, FontFzxy.Height, FontFzxy.Height + 20);

            //t.Stop();

            //delta = (int)t.ElapsedMilliseconds;
            //e.Graphics.TextRenderingHint = TextRenderingHint.SystemDefault;
            //e.Graphics.DrawString("娃哈哈看得见哦 AaBbCc@#$%^&*IO", FontFzTjls, Brushes.Blue, FontFzTjls.Height, FontFzTjls.Height + 20 * 2);

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //a.AddFontFile(AppDomain.CurrentDomain.BaseDirectory + "font/方正细圆简体.ttf");
            //a.AddFontFile(AppDomain.CurrentDomain.BaseDirectory + "font/方正兰亭纤黑_GBK.TTF");

            this.gdiControl1.Start();
           
        }

    }
}
